//
//  NillView.m
//  OralRobot
//
//  Created by 王桂敏 on 16/7/18.
//  Copyright © 2016年 wangguimin. All rights reserved.
//

#import "NillView.h"

@interface NillView ()

@end

@implementation NillView


- (id)initViewWithType:(NillViewType)type
                 frame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.offsetY = 0;
        [self setViewWithType:type];
    }
    return self;
}

- (void)setViewWithType:(NillViewType)type{
    self.type = type;
    switch (type) {
        case NillViewType0:
        {
            
            self.backgroundColor = ColorWithHexString(@"f2f8fa");
            
            UIImageView *imageIcon = [UIImageView imageViewWithFrame:CGRectMake(0, 0, w(193), h(220)) image:@"bg_zanwushuju"];
            imageIcon.userInteractionEnabled = YES;
            imageIcon.centerX = self.width / 2;
            imageIcon.centerY = (kScreenHeight - 64 - 49) / 2;
            [self addSubview:imageIcon];
            UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapGestureRecognizer:)];
            
            [self addGestureRecognizer:tap];
            
            
        }
            break;
        case NillViewType1:
        {
            
           
            
        }
            break;
        
        default:
            break;
    }
}


#pragma mark - GestureAction -
- (void)didTapGestureRecognizer:(UITapGestureRecognizer *)sender{
   
    if (self.blockOfbackground) {
        self.blockOfbackground();
    }
}

#pragma mark - buttonAction - 
- (void)buttonAction0:(UIButton *)sender{
    if (self.block) {
        self.block();
    }
}
- (void)buttonAction1:(UIButton *)sender{
    if (self.block1) {
        self.block1();
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
